/*
 * @Descripttion: 
 * @version: 
 * @Author: Wynters
 * @Date: 2024-05-10 16:11:29
 * @LastEditTime: 2024-05-29 16:17:40
 * @FilePath: \RustPanel\src\api\v1\user.rs
 */

use actix_web::HttpResponse;

use crate::api::auth::AuthUser;

pub async fn get_me(user: AuthUser) -> HttpResponse {
    HttpResponse::Ok().json(user)
}

pub async fn get_menus(_: AuthUser) -> HttpResponse {

    let menus = serde_json::json!([{"id":1,"pid":1,"type":"1","sort":1,"name":"home","path":"/home","icon":"HomeOutlined","key":"home","remark":"首页","pivot":{"group_id":1,"rule_id":1}},{"id":2,"pid":2,"type":"2","sort":2,"name":"website","path":"/web/list","icon":"GlobalOutlined","key":"web.list","remark":"站点管理","pivot":{"group_id":1,"rule_id":1}},{"id":3,"pid":3,"type":"3","sort":3,"name":"file","path":"/file/list","icon":"FileOutlined","key":"file.list","remark":"文件管理","pivot":{"group_id":1,"rule_id":1}},{"id":2,"pid":0,"type":"0","sort":2,"name":"组件 & 功能","path":"/data","icon":"PieChartOutlined","key":"data","remark":"数据展示","update_time":"2023-10-18 16:11:55","create_time":"2023-08-10 15:44:12","pivot":{"group_id":1,"rule_id":2},"children":[{"id":3,"pid":2,"type":"1","sort":0,"name":"定义列表","path":"/data/descriptions","icon":"UnorderedListOutlined","key":"data.descriptions","remark":"定义列表","update_time":"2023-09-22 09:44:52","create_time":"2023-08-15 20:26:36","pivot":{"group_id":1,"rule_id":3}},{"id":35,"pid":2,"type":"1","sort":0,"name":"高级列表","path":"/data/list","icon":null,"key":"data.list","remark":"高级列表","update_time":"2023-09-22 09:45:29","create_time":"2023-08-18 09:47:43","pivot":{"group_id":1,"rule_id":35}},{"id":36,"pid":2,"type":"1","sort":0,"name":"单选卡片","path":"/data/checkcard","icon":null,"key":"data.checkcard","remark":"单选卡片","update_time":"2023-09-22 09:45:32","create_time":"2023-08-18 09:49:58","pivot":{"group_id":1,"rule_id":36}},{"id":86,"pid":2,"type":"1","sort":0,"name":"表单示例","path":"/data/form","icon":null,"key":"data.form","remark":"表单示例","update_time":"2023-10-18 16:23:42","create_time":"2023-10-18 16:13:10","pivot":{"group_id":1,"rule_id":86}}]},{"id":39,"pid":0,"type":"0","sort":4,"name":"会员管理","path":"/user","icon":"TeamOutlined","key":"user","remark":"会员管理","update_time":"2023-09-14 16:19:11","create_time":"2023-08-28 20:37:52","pivot":{"group_id":1,"rule_id":39},"children":[{"id":40,"pid":39,"type":"1","sort":0,"name":"会员列表","path":"/user/list","icon":null,"key":"user.list","remark":"会员列表","update_time":"2023-09-27 17:31:17","create_time":"2023-08-28 20:38:14","pivot":{"group_id":1,"rule_id":40}},{"id":69,"pid":39,"type":"1","sort":2,"name":"会员分组","path":"/user/group","icon":null,"key":"user.group","remark":"会员分组","update_time":"2023-09-27 17:13:20","create_time":"2023-09-27 17:13:20","pivot":{"group_id":1,"rule_id":69}},{"id":70,"pid":39,"type":"1","sort":2,"name":"权限管理","path":"/user/rule","icon":null,"key":"user.rule","remark":"权限管理","update_time":"2023-09-27 17:15:35","create_time":"2023-09-27 17:14:42","pivot":{"group_id":1,"rule_id":70}},{"id":81,"pid":39,"type":"1","sort":4,"name":"会员余额记录","path":"/user/money_log","icon":null,"key":"user.money_log","remark":"会员余额记录","update_time":"2023-10-17 17:07:09","create_time":"2023-10-17 17:07:09","pivot":{"group_id":1,"rule_id":81}}]},{"id":6,"pid":0,"type":"0","sort":5,"name":"管理员设置","path":"/admin","icon":"IdcardOutlined","key":"admin","remark":"管理员设置","update_time":"2023-09-14 16:19:31","create_time":"2023-08-16 03:12:08","pivot":{"group_id":1,"rule_id":6},"children":[{"id":7,"pid":6,"type":"1","sort":0,"name":"管理员列表","path":"/admin/list","icon":null,"key":"admin.list","remark":"管理员列表","update_time":"2023-09-12 16:23:27","create_time":"2023-08-16 03:13:06","pivot":{"group_id":1,"rule_id":7}},{"id":8,"pid":6,"type":"1","sort":1,"name":"管理员分组","path":"/admin/group","icon":null,"key":"admin.group","remark":"管理员分组","update_time":"2023-09-14 16:22:34","create_time":"2023-08-16 03:13:45","pivot":{"group_id":1,"rule_id":8}},{"id":9,"pid":6,"type":"1","sort":2,"name":"权限管理","path":"/admin/rule","icon":null,"key":"admin.rule","remark":"权限管理","update_time":"2023-09-14 16:22:41","create_time":"2023-08-16 03:14:36","pivot":{"group_id":1,"rule_id":9}}]},{"id":10,"pid":0,"type":"0","sort":6,"name":"系统管理","path":"/system","icon":"SettingOutlined","key":"system","remark":"系统管理","update_time":"2023-08-29 20:47:01","create_time":"2023-08-16 03:26:17","pivot":{"group_id":1,"rule_id":10},"children":[{"id":11,"pid":10,"type":"1","sort":0,"name":"字典管理","path":"/system/dict","icon":null,"key":"system.dict","remark":"字典管理","update_time":"2023-09-12 16:23:46","create_time":"2023-08-16 03:26:47","pivot":{"group_id":1,"rule_id":11}},{"id":49,"pid":10,"type":"1","sort":0,"name":"系统信息","path":"/system/info","icon":null,"key":"system.info","remark":"系统设置","update_time":"2023-09-14 08:43:47","create_time":"2023-08-29 20:48:03","pivot":{"group_id":1,"rule_id":49}},{"id":50,"pid":10,"type":"1","sort":3,"name":"系统设置","path":"/system/setting","icon":null,"key":"system.setting","remark":"系统设置","update_time":"2023-09-14 08:52:50","create_time":"2023-09-14 08:49:58","pivot":{"group_id":1,"rule_id":50}}]},{"id":43,"pid":0,"type":"0","sort":8,"name":"在线开发","path":"/online","icon":"RocketOutlined","key":"online","remark":"在线开发","update_time":"2023-08-29 20:48:50","create_time":"2023-08-28 20:40:32","pivot":{"group_id":1,"rule_id":43},"children":[{"id":44,"pid":43,"type":"1","sort":0,"name":"表格设计","path":"/online/table","icon":null,"key":"online.table","remark":"表格设计","update_time":"2023-09-12 16:24:07","create_time":"2023-08-28 20:41:00","pivot":{"group_id":1,"rule_id":44}}]}]);




    HttpResponse::Ok().json(serde_json::json!({"data":{"info":{"id":1,"username":"admin","nickname":"Xin Admin","avatar":"https://api.iconify.design/logos:github-copilot.svg?color=#888888","sex":"0","email":"111@qq.com","mobile":"15966666666","status":"1","group_id":1,"create_time":"2022-02-26 19:55:29","update_time":"2023-10-19 14:34:00"},"access":["admin.list", "admin.group", "home", "system","file.list","web.list", "system.dict", "admin.rule", "admin.list.list", "admin.list.add", "admin.list.edit", "admin.group.list", "admin.group.add", "admin.group.edit", "admin.group.rule", "admin.group.ruleEdit", "system.dict.list", "data.descriptions", "system.dict.add", "admin.rule.list", "admin.rule.add", "admin.rule.edit", "system.dict.item.list", "system.dict.item.add", "system.dict.item.edit", "data.list", "data.checkcard", "admin.group.delete", "system.dict.delete", "system.dict.edit", "system.dict.item.delete", "admin.list.delete", "admin.rule.delete", "user.list", "online.table", "user", "system.info", "online", "xinadmin", "admin", "data", "system.setting", "system.setting.querySettingGroup", "system.setting.addGroup", "system.setting.querySettingPid", "online.table.list", "online.table.edit", "online.table.delete", "online.table.devise", "online.table.saveData", "online.table.getData", "online.table.crud", "system.setting.list", "system.setting.add", "system.setting.edit", "system.setting.delete", "content.article.add", "content.article.edit", "content.article.delete", "content.article.list", "user.rule", "user.group", "user.list", "user.edit", "user.add", "user.delete", "user.group.add", "user.group.list", "user.group.edit", "user.group.delete", "user.group.rule", "user.group.ruleEdit", "user.money_log", "user.money_log.list", "user.money_log.add", "online.table.add", "user.money_log.delete", "data.form", "admin.list.updatePwd"],"menus":menus,"success":true,"status":200,"msg":"ok","showType":0}}))
}